using AdminSG3L.Applicaticn.Dtos;

namespace AdminSG3L.Applicaticn.ServicesInterface;

/// <summary>
/// 分析统计服务接口
/// </summary>
public interface IAnalyticsService
{
    /// <summary>
    /// 获取仪表盘数据
    /// </summary>
    Task<object> GetDashboardDataAsync(string timeRange);

    /// <summary>
    /// 获取访问统计
    /// </summary>
    Task<object> GetVisitStatsAsync(VisitStatsQueryDto query);

    /// <summary>
    /// 获取用户行为分析
    /// </summary>
    Task<object> GetUserBehaviorAsync(string userId, UserBehaviorQueryDto query);

    /// <summary>
    /// 获取页面访问统计
    /// </summary>
    Task<object> GetPageStatsAsync(VisitStatsQueryDto query);

    /// <summary>
    /// 获取实时数据
    /// </summary>
    Task<object> GetRealTimeDataAsync();

    /// <summary>
    /// 获取转化漏斗数据
    /// </summary>
    Task<object> GetFunnelDataAsync(Guid funnelId, VisitStatsQueryDto query);

    /// <summary>
    /// 获取留存分析
    /// </summary>
    Task<object> GetRetentionAnalysisAsync(RetentionQueryDto query);

    /// <summary>
    /// 获取用户画像数据
    /// </summary>
    Task<object> GetUserPortraitAsync(UserPortraitQueryDto query);

    /// <summary>
    /// 获取热力图数据
    /// </summary>
    Task<object> GetHeatmapDataAsync(HeatmapQueryDto query);

    /// <summary>
    /// 获取事件统计
    /// </summary>
    Task<object> GetEventStatsAsync(EventStatsQueryDto query);

    /// <summary>
    /// 记录用户行为事件
    /// </summary>
    Task<object> TrackEventAsync(UserBehaviorDto eventData);

    /// <summary>
    /// 批量记录用户行为事件
    /// </summary>
    Task<object> BatchTrackEventsAsync(List<UserBehaviorDto> events);

    /// <summary>
    /// 创建自定义报表
    /// </summary>
    Task<object> CreateCustomReportAsync(CustomReportConfigDto reportConfig);

    /// <summary>
    /// 获取报表列表
    /// </summary>
    Task<object> GetReportsAsync(int page, int pageSize);

    /// <summary>
    /// 获取报表详情
    /// </summary>
    Task<ResponseDto> GetReportByIdAsync(Guid reportId);

    /// <summary>
    /// 更新报表
    /// </summary>
    Task<ResponseDto> UpdateReportAsync(Guid reportId, CustomReportConfigDto reportConfig);

    /// <summary>
    /// 删除报表
    /// </summary>
    Task<object> DeleteReportAsync(Guid reportId);

    /// <summary>
    /// 导出报表
    /// </summary>
    Task<ResponseDto<byte[]>> ExportReportAsync(Guid reportId, string format);

    /// <summary>
    /// 获取数据对比分析
    /// </summary>
    Task<object> GetComparisonDataAsync(ComparisonQueryDto query);

    /// <summary>
    /// 获取趋势分析
    /// </summary>
    Task<object> GetTrendAnalysisAsync(TrendAnalysisQueryDto query);

    /// <summary>
    /// 获取异常检测数据
    /// </summary>
    Task<object> GetAnomalyDetectionAsync(AnomalyDetectionQueryDto query);

    /// <summary>
    /// 获取预测分析
    /// </summary>
    Task<object> GetPredictionDataAsync(PredictionQueryDto query);

    /// <summary>
    /// 创建数据提醒
    /// </summary>
    Task<object> CreateAlertAsync(AlertConfigDto alertConfig);

    /// <summary>
    /// 获取提醒列表
    /// </summary>
    Task<List<AlertDto>> GetAlertsAsync();

    /// <summary>
    /// 更新提醒状态
    /// </summary>
    Task<object> UpdateAlertStatusAsync(Guid alertId, string status);

    /// <summary>
    /// 删除提醒
    /// </summary>
    Task<object> DeleteAlertAsync(Guid alertId);

    /// <summary>
    /// 获取系统性能指标
    /// </summary>
    Task<object> GetSystemMetricsAsync();

    /// <summary>
    /// 获取数据统计概览
    /// </summary>
    Task<object> GetDataOverviewAsync(DateTime? startDate = null, DateTime? endDate = null);

    /// <summary>
    /// 计算业务指标
    /// </summary>
    Task<object> CalculateBusinessMetricsAsync(List<string> metrics, DateTime? startDate, DateTime? endDate);

    /// <summary>
    /// 获取用户分群数据
    /// </summary>
    Task<object> GetUserSegmentsAsync(UserPortraitQueryDto query);

    /// <summary>
    /// 获取转化路径分析
    /// </summary>
    Task<object> GetConversionPathsAsync(DateTime? startDate, DateTime? endDate);

    /// <summary>
    /// 获取用户生命周期分析
    /// </summary>
    Task<object> GetUserLifecycleAsync(DateTime? startDate, DateTime? endDate);

    /// <summary>
    /// 获取归因分析
    /// </summary>
    Task<object> GetAttributionAnalysisAsync(string conversionEvent, DateTime? startDate, DateTime? endDate);

    /// <summary>
    /// 获取页面性能分析
    /// </summary>
    Task<PagePerformanceDto> GetPagePerformanceAsync(string? pageUrl, DateTime? startDate, DateTime? endDate);

    /// <summary>
    /// 获取错误跟踪数据
    /// </summary>
    Task<object> GetErrorTrackingAsync(DateTime? startDate, DateTime? endDate);

    /// <summary>
    /// 生成洞察报告
    /// </summary>
    Task<object> GenerateInsightsAsync(string reportType, DateTime? startDate, DateTime? endDate);

    /// <summary>
    /// 获取A/B测试结果
    /// </summary>
    Task<object> GetAbTestResultsAsync(string? testId);

    /// <summary>
    /// 清理过期分析数据
    /// </summary>
    Task<object> CleanupExpiredDataAsync(int keepDays);

    /// <summary>
    /// 导出分析数据
    /// </summary>
    Task<ResponseDto<byte[]>> ExportAnalyticsDataAsync(string dataType, DateTime? startDate, DateTime? endDate, string format);

    /// <summary>
    /// 获取数据质量报告
    /// </summary>
    Task<object> GetDataQualityReportAsync(DateTime? startDate, DateTime? endDate);
}